package com.wp.design.structural.flyweight;

import java.util.HashMap;
import java.util.Map;

public class EmployeeFactory {
	private static final Map<String,Employee> EMPLOYEE_MAP = new HashMap<String, Employee>();
	public static Employee getManager(String deptName){
		Manager manage = (Manager)EMPLOYEE_MAP.get(deptName);
		if (manage == null){
			manage = new Manager(deptName);
			System.out.println("创建"+deptName+"部门经理成功:");
			System.out.println("创建"+deptName+"部门汇报");
			manage.setReportContent(deptName+"部门汇报");
			EMPLOYEE_MAP.put(deptName,manage);
		}
		return manage;
	}
}
